package com.tianpengtech.admin.platformincome;

import com.jfinal.aop.Before;
import com.jfinal.plugin.activerecord.Model;
import com.tianpengtech.admin.AbstractAdminController;
import com.tianpengtech.admin.InitInterceptor;
import com.tianpengtech.common.exception.ValidateException;
import com.tianpengtech.common.model.fair.Fair;
import com.tianpengtech.common.model.platformincome.PlatFormIncome;

/**
* 路由配置地址：add("/admin/platformincome", PlatFormIncomeAdminController.class, "/admin/platformincome");
* 数据库映射地址：arp.addMapping(PlatFormIncome.dao.tableName(),PlatFormIncome.class);
*/
@Before(InitInterceptor.class)
public class PlatFormIncomeAdminController extends AbstractAdminController{

	@Override
	protected void config() {
		this.clazz=PlatFormIncome.class;
		this.service=new PlatFormIncomeAdminServiceImpl();
	}

	@Override
	public void beforeAdd() {

	}

	@Override
	public void beforeAdd(Model< ? > model) throws ValidateException {

	}

	@Override
	public void beforeQueryById(Model<?> model, int id) {

	}

	@Override
	public void beforeUpdate(Model< ? > model) throws ValidateException {

	}

	@Override
	public void beforeDelete(Model< ? > model) {

	}

	@Override
	public void parsePageRecord(Object results) {
		PlatFormIncome temp = (PlatFormIncome)results;
		Fair fair = Fair.dao.findById(temp.getLong(PlatFormIncome.WH_ID));
		if(fair!=null){
			temp.put("wh_id_str",fair.getStr(Fair.NICK_NAME));
		}
		temp.set(PlatFormIncome.STATUS, temp.status());
	}
}

	